home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung CD 2 (Tewi)(1994).iso / doc / ems / disk3 / emmlib.h < prev    next >
Text File  |  1989-11-29  |  58KB  |  918 lines

  1. /*===========================================================================*/
  2. /*                          EMM FUNCTION CLASSES                             */
  3. /*------------------------------------+--------------------------------------*/
  4. /*     PRESENCE, STATUS, & VERSION    |      MEMORY MOVEMENT & EXCHANGE      */
  5. /*------------------------------------+--------------------------------------*/
  6. /*   EMM_installed                    |   move_memory_region                 */
  7. /*   get_EMM_status                   |   xchg_memory_region                 */
  8. /*   get_EMM_version                  |                                      */
  9. /*                                    |                                      */
  10. /*------------------------------------+--------------------------------------*/
  11. /*          MEMORY ALLOCATION         |           HANDLE MANAGEMENT          */
  12. /*------------------------------------+--------------------------------------*/
  13. /*   get_unalloc_page_count           |   get_handle_count                   */
  14. /*   get_alloc_page_count             |   get_handle_pages                   */
  15. /*   get_total_page_count             |   get_all_handles_pages              */
  16. /*   get_unalloc_raw_page_count       |   get_handle_attrib                  */
  17. /*   get_alloc_raw_page_count         |   set_handle_attrib                  */
  18. /*   get_total_raw_page_count         |   get_attrib_capability              */
  19. /*   alloc_pages                      |   get_handle_name                    */
  20. /*   dealloc_pages                    |   set_handle_name                    */
  21. /*   realloc_pages                    |   get_handle_dir                     */
  22. /*   alloc_std_pages                  |   search_handle_name                 */
  23. /*   alloc_raw_pages                  |   get_total_handles                  */
  24. /*                                    |                                      */
  25. /*------------------------------------+--------------------------------------*/
  26. /*     MAPPABLE MEMORY REGION INFO    |         PROGRAM FLOW CONTROL         */
  27. /*------------------------------------+--------------------------------------*/
  28. /*   get_page_frame_seg               |   alter_map_jump                     */
  29. /*   get_mappable_conv_regions        |   alter_map_call                     */
  30. /*   get_mappable_exp_regions         |   get_alter_map_call_stack_size      */
  31. /*   get_mappable_regions             |                                      */
  32. /*   get_mappable_conv_region_count   |                                      */
  33. /*   get_mappable_exp_region_count    |                                      */
  34. /*   get_mappable_region_count        |                                      */
  35. /*   get_page_frame_count             |                                      */
  36. /*                                    |                                      */
  37. /*------------------------------------+--------------------------------------*/
  38. /*           MEMORY MAPPING           |                OS ONLY               */
  39. /*------------------------------------+--------------------------------------*/
  40. /*   map_unmap_page                   |   enable_OS_fcns                     */
  41. /*   map_unmap_pages                  |   disable_OS_fcns                    */
  42. /*                                    |   return_OS_access_key               */
  43. /*------------------------------------+   get_hw_info                        */
  44. /*       MEMORY MAPPING CONTEXT       |   get_alt_reg_set                    */
  45. /*------------------------------------+   set_alt_reg_set                    */
  46. /*   save_context                     |   get_alt_context_size               */
  47. /*   restore_context                  |   alloc_alt_reg_set                  */
  48. /*   get_context                      |   dealloc_alt_reg_set                */
  49. /*   set_context                      |   alloc_DMA_reg_set                  */
  50. /*   get_set_context                  |   enable_DMA_reg_set                 */
  51. /*   get_context_size                 |   disable_DMA_reg_set                */
  52. /*   get_partial_context              |   dealloc_DMA_reg_set                */
  53. /*   get_partial_context_size         |   prep_EMM_warmboot                  */
  54. /*   set_partial_context              |                                      */
  55. /*                                    |                                      */
  56. /*====================================+======================================*/
  57.  
  58. /*===========================================================================*/
  59. /*                           EMM MANIFEST CONSTANTS                          */
  60. /*===========================================================================*/
  61. #define MAX_HANDLES             255
  62. #define MAX_HANDLE_NAME_LEN     8
  63. #define VOLATILE                0
  64. #define NONVOLATILE             1
  65. #define MAX_MAPPABLE_REGIONS    64
  66. #define PHYS_PAGE_MODE          0
  67. #define SEG_MODE                1
  68. #define MAX_CONTEXT_SIZE        255
  69. #define CONV_MEM                0
  70. #define EXP_MEM                 1
  71. #define UNMAP                   0xFFFF
  72.  
  73. /*===========================================================================*/
  74. /*                                 EMM MACRO                                 */
  75. /*===========================================================================*/
  76.     /*-----------------------------------------------------------------------*/
  77.     /*   This macro converts an unsigned int containing a segment address,   */
  78.     /*   into a far pointer to a void.  It is useful in converting the       */
  79.     /*   segment values, returned by EMM function calls, into far pointers   */
  80.     /*   which C programs can use.  For example:                             */
  81.     /*                                                                       */
  82.     /*   unsigned int status,                                                */
  83.     /*                  page_frame_seg;                                      */
  84.     /*   char far *page_frame_ptr;                                           */
  85.     /*                                                                       */
  86.     /*   status = get_page_frame_seg (&page_frame_seg);                      */
  87.     /*   page_frame_ptr = FP(page_frame_seg);                                */
  88.     /*   *page_frame_ptr = 0;                                                */
  89.     /*-----------------------------------------------------------------------*/
  90.     #define FP(SEG) ((void far *)((unsigned long)SEG << 16))
  91.  
  92. /*===========================================================================*/
  93. /*                           EMM STRUCTURE TYPEDEFS                          */
  94. /*===========================================================================*/
  95.     /*-----------------------------------------------------------------------*/
  96.     /*               Structure:   HANDLES_PAGES_STRUCT                       */
  97.     /*                                                                       */
  98.     /*   Required by Functions:   get_all_handles_pages                      */
  99.     /*-----------------------------------------------------------------------*/
  100.     #pragma pack(1)
  101.     typedef struct
  102.     {
  103.         unsigned int            handle;
  104.         unsigned int            pages_allocated;
  105.     } HANDLES_PAGES_STRUCT;
  106.     #pragma pack()
  107.  
  108.     /*-----------------------------------------------------------------------*/
  109.     /*               Structure:   HANDLE_NAME_STRUCT                         */
  110.     /*                                                                       */
  111.     /*   Required by Functions:   get_handle_name                            */
  112.     /*                            set_handle_name                            */
  113.     /*                            search_handle_name                         */
  114.     /*-----------------------------------------------------------------------*/
  115.     #pragma pack(1)
  116.     typedef struct
  117.     {
  118.         unsigned char            name [MAX_HANDLE_NAME_LEN];
  119.     } HANDLE_NAME_STRUCT;
  120.     #pragma pack()
  121.  
  122.     /*-----------------------------------------------------------------------*/
  123.     /*               Structure:   HANDLE_DIR_STRUCT                          */
  124.     /*                                                                       */
  125.     /*   Required by Functions:   get_handle_dir                             */
  126.     /*-----------------------------------------------------------------------*/
  127.     #pragma pack(1)
  128.     typedef struct
  129.     {
  130.         unsigned int            handle;
  131.         unsigned char            name [MAX_HANDLE_NAME_LEN];
  132.     } HANDLE_DIR_STRUCT;
  133.     #pragma pack()
  134.  
  135.     /*-----------------------------------------------------------------------*/
  136.     /*               Structure:   CONTEXT_STRUCT                             */
  137.     /*                                                                       */
  138.     /*   Required by Functions:   get_context                                */
  139.     /*                            set_context                                */
  140.     /*                            get_set_context                            */
  141.     /*                            get_partial_context                        */
  142.     /*                            set_partial_context                        */
  143.     /*                            set_alt_reg_set                            */
  144.     /*-----------------------------------------------------------------------*/
  145.     #pragma pack(1)
  146.     typedef struct
  147.     {
  148.         unsigned char            reserved [MAX_CONTEXT_SIZE];
  149.     } CONTEXT_STRUCT;
  150.     #pragma pack()
  151.  
  152.     /*-----------------------------------------------------------------------*/
  153.     /*               Structure:   PARTIAL_CONTEXT_LIST_STRUCT                */
  154.     /*                                                                       */
  155.     /*   Required by Functions:   get_partial_context                        */
  156.     /*-----------------------------------------------------------------------*/
  157.     #pragma pack(1)
  158.     typedef struct
  159.     {
  160.         unsigned int            mappable_region_count;
  161.         unsigned int            mappable_region_seg [MAX_MAPPABLE_REGIONS];
  162.     } PARTIAL_CONTEXT_LIST_STRUCT;
  163.     #pragma pack()
  164.  
  165.     /*-----------------------------------------------------------------------*/
  166.     /*               Structure:   MAP_STRUCT                                 */
  167.     /*                                                                       */
  168.     /*   Required by Functions:   map_unmap_pages                            */
  169.     /*                            alter_map_jump                             */
  170.     /*                            alter_map_call                             */
  171.     /*-----------------------------------------------------------------------*/
  172.     #pragma pack(1)
  173.     typedef struct
  174.     {
  175.         unsigned int            log_page;
  176.         unsigned int            phys_page_or_seg;
  177.     } MAP_STRUCT;
  178.     #pragma pack()
  179.  
  180.     /*-----------------------------------------------------------------------*/
  181.     /*               Structure:   MAP_JUMP_STRUCT                            */
  182.     /*                                                                       */
  183.     /*   Required by Functions:   alter_map_jump                             */
  184.     /*-----------------------------------------------------------------------*/
  185.     #pragma pack(1)
  186.     typedef struct
  187.     {
  188.         void                    (far *target_function) ();
  189.         unsigned char            map_struct_count;
  190.         MAP_STRUCT far *        ptr_map_struct;
  191.     } MAP_JUMP_STRUCT;
  192.     #pragma pack()
  193.  
  194.     /*-----------------------------------------------------------------------*/
  195.     /*               Structure:   MAP_CALL_STRUCT                            */
  196.     /*                                                                       */
  197.     /*   Required by Functions:   alter_map_call                             */
  198.     /*-----------------------------------------------------------------------*/
  199.     #pragma pack(1)
  200.     typedef struct
  201.     {
  202.         void                    (far *target_function) ();
  203.         unsigned char            init_map_struct_count;
  204.         MAP_STRUCT far *        ptr_init_map_struct;
  205.         unsigned char            final_map_struct_count;
  206.         MAP_STRUCT far *        ptr_final_map_struct;
  207.         unsigned char            reserved[8];
  208.     } MAP_CALL_STRUCT;
  209.     #pragma pack()
  210.  
  211.     /*-----------------------------------------------------------------------*/
  212.     /*               Structure:   MOVE_XCHG_STRUCT                           */
  213.     /*                                                                       */
  214.     /*   Required by Functions:   move_memory_region                         */
  215.     /*                            xchg_memory_region                         */
  216.     /*-----------------------------------------------------------------------*/
  217.     #pragma pack(1)
  218.     typedef struct
  219.     {
  220.         unsigned long            region_size;
  221.         unsigned char            source_mem_type;
  222.         unsigned int            source_handle;
  223.         unsigned int            source_init_offset;
  224.         unsigned int            source_init_log_page_or_seg;
  225.         unsigned char            dest_mem_type;
  226.         unsigned int            dest_handle;
  227.         unsigned int            dest_init_offset;
  228.         unsigned int            dest_init_log_page_or_seg;
  229.     } MOVE_XCHG_STRUCT;
  230.     #pragma pack()
  231.  
  232.     /*-----------------------------------------------------------------------*/
  233.     /*               Structure:   MAPPABLE_REGION_STRUCT                     */
  234.     /*                                                                       */
  235.     /*   Required by Functions:   get_mappable_conv_regions                  */
  236.     /*                            get_mappable_exp_regions                   */
  237.     /*                            get_mappable_regions                       */
  238.     /*-----------------------------------------------------------------------*/
  239.     #pragma pack(1)
  240.     typedef struct
  241.     {
  242.         unsigned int            mappable_region_seg;
  243.         unsigned int            phys_page;
  244.     } MAPPABLE_REGION_STRUCT;
  245.     #pragma pack()
  246.  
  247.     /*-----------------------------------------------------------------------*/
  248.     /*               Structure:   HW_INFO_STRUCT                             */
  249.     /*                                                                       */
  250.     /*   Required by Functions:   get_hw_info                                */
  251.     /*-----------------------------------------------------------------------*/
  252.     #pragma pack(1)
  253.     typedef struct
  254.     {
  255.         unsigned int            raw_page_size_paragraphs;
  256.         unsigned int            alt_reg_set_count;
  257.         unsigned int            context_size;
  258.         unsigned int            DMA_reg_set_count;
  259.         unsigned int            DMA_channel_operation;
  260.     } HW_INFO_STRUCT;
  261.     #pragma pack()
  262.  
  263. /*===========================================================================*/
  264. /*                          EMM FUNCTION PROTOTYPES                          */
  265. /*===========================================================================*/
  266.     /*-----------------------------------------------------------------------*/
  267.     /*   unsigned int status;                                                */
  268.     /*                                                                       */
  269.     /*   status = EMM_installed ();                                          */
  270.     /*-----------------------------------------------------------------------*/
  271.     unsigned int EMM_installed    (void);
  272.  
  273.     /*-----------------------------------------------------------------------*/
  274.     /*   unsigned int status;                                                */
  275.     /*                                                                       */
  276.     /*   status = get_EMM_status ();                                         */
  277.     /*-----------------------------------------------------------------------*/
  278.     unsigned int get_EMM_status    (void);
  279.  
  280.     /*-----------------------------------------------------------------------*/
  281.     /*   unsigned int status,                                                */
  282.     /*                page_frame_seg;                                        */
  283.     /*                                                                       */
  284.     /*   status = get_page_frame_seg (&page_frame_seg);                      */
  285.     /*-----------------------------------------------------------------------*/
  286.     unsigned int get_page_frame_seg    (unsigned int far *);
  287.  
  288.     /*-----------------------------------------------------------------------*/
  289.     /*   unsigned int status,                                                */
  290.     /*                unalloc_page_count;                                    */
  291.     /*                                                                       */
  292.     /*   status = get_unalloc_page_count (&unalloc_page_count);              */
  293.     /*-----------------------------------------------------------------------*/
  294.     unsigned int get_unalloc_page_count    (unsigned int far *);
  295.  
  296.     /*-----------------------------------------------------------------------*/
  297.     /*   unsigned int status,                                                */
  298.     /*                alloc_page_count;                                      */
  299.     /*                                                                       */
  300.     /*   status = get_alloc_page_count (&alloc_page_count);                  */
  301.     /*-----------------------------------------------------------------------*/
  302.     unsigned int get_alloc_page_count    (unsigned int far *);
  303.  
  304.     /*-----------------------------------------------------------------------*/
  305.     /*   unsigned int status,                                                */
  306.     /*                total_page_count;                                      */
  307.     /*                                                                       */
  308.     /*   status = get_total_page_count (&total_page_count);                  */
  309.     /*-----------------------------------------------------------------------*/
  310.     unsigned int get_total_page_count    (unsigned int far *);
  311.  
  312.     /*-----------------------------------------------------------------------*/
  313.     /*   unsigned int status,                                                */
  314.     /*                pages,                                                 */
  315.     /*                handle;                                                */
  316.     /*                                                                       */
  317.     /*   status = alloc_pages (pages,                                        */
  318.     /*                         &handle);                                     */
  319.     /*-----------------------------------------------------------------------*/
  320.     unsigned int alloc_pages    (unsigned int,
  321.                                       unsigned int far *);
  322.  
  323.     /*-----------------------------------------------------------------------*/
  324.     /*   unsigned int status,                                                */
  325.     /*                phys_page,                                             */
  326.     /*                log_page,                                              */
  327.     /*                handle;                                                */
  328.     /*                                                                       */
  329.     /*   status = map_unmap_page (phys_page,                                 */
  330.     /*                            log_page,                                  */
  331.     /*                            handle);                                   */
  332.     /*-----------------------------------------------------------------------*/
  333.     unsigned int map_unmap_page    (unsigned int,
  334.                                            unsigned int,
  335.                                            unsigned int);
  336.  
  337.     /*-----------------------------------------------------------------------*/
  338.     /*   unsigned int status,                                                */
  339.     /*                handle;                                                */
  340.     /*                                                                       */
  341.     /*   status = dealloc_pages (handle);                                    */
  342.     /*-----------------------------------------------------------------------*/
  343.     unsigned int dealloc_pages    (unsigned int);
  344.  
  345.     /*-----------------------------------------------------------------------*/
  346.     /*   unsigned int status,                                                */
  347.     /*                version;                                               */
  348.     /*                                                                       */
  349.     /*   status = get_EMM_version (&version);                                */
  350.     /*-----------------------------------------------------------------------*/
  351.     unsigned int get_EMM_version    (unsigned int far *);
  352.  
  353.     /*-----------------------------------------------------------------------*/
  354.     /*   unsigned int status,                                                */
  355.     /*                handle;                                                */
  356.     /*                                                                       */
  357.     /*   status = save_context (handle);                                     */
  358.     /*-----------------------------------------------------------------------*/
  359.     unsigned int save_context (unsigned int);
  360.  
  361.     /*-----------------------------------------------------------------------*/
  362.     /*   unsigned int status,                                                */
  363.     /*                handle;                                                */
  364.     /*                                                                       */
  365.     /*   status = restore_context (handle);                                  */
  366.     /*-----------------------------------------------------------------------*/
  367.     unsigned int restore_context    (unsigned int);
  368.  
  369.     /*-----------------------------------------------------------------------*/
  370.     /*   unsigned int status,                                                */
  371.     /*                handle_count;                                          */
  372.     /*                                                                       */
  373.     /*   status = get_handle_count (&handle_count);                          */
  374.     /*-----------------------------------------------------------------------*/
  375.     unsigned int get_handle_count    (unsigned int far *);
  376.  
  377.     /*-----------------------------------------------------------------------*/
  378.     /*   unsigned int status,                                                */
  379.     /*                pages_alloc_to_handle,                                 */
  380.     /*                handle;                                                */
  381.     /*                                                                       */
  382.     /*   status = get_handle_pages (&pages_alloc_to_handle,                  */
  383.     /*                              handle);                                 */
  384.     /*-----------------------------------------------------------------------*/
  385.     unsigned int get_handle_pages    (unsigned int far *,
  386.                                            unsigned int);
  387.  
  388.     /*-----------------------------------------------------------------------*/
  389.     /*   unsigned             int status,                                    */
  390.     /*                        hp_count;                                      */
  391.     /*   HANDLES_PAGES_STRUCT hp [MAX_HANDLES];                              */
  392.     /*                                                                       */
  393.     /*   status = get_all_handles_pages (&hp_count,                          */
  394.     /*                                   hp);                                */
  395.     /*-----------------------------------------------------------------------*/
  396.     unsigned int get_all_handles_pages    (unsigned int far *,
  397.                                                    HANDLES_PAGES_STRUCT far *);
  398.  
  399.     /*-----------------------------------------------------------------------*/
  400.     /*   unsigned int   status;                                              */
  401.     /*   CONTEXT_STRUCT dest_context;                                        */
  402.     /*                                                                       */
  403.     /*   status = get_context (&dest_context);                               */
  404.     /*-----------------------------------------------------------------------*/
  405.     unsigned int get_context    (CONTEXT_STRUCT far *);
  406.  
  407.     /*-----------------------------------------------------------------------*/
  408.     /*   unsigned int   status;                                              */
  409.     /*   CONTEXT_STRUCT source_context;                                      */
  410.     /*                                                                       */
  411.     /*   status = set_context (&source_context);                             */
  412.     /*-----------------------------------------------------------------------*/
  413.     unsigned int set_context    (CONTEXT_STRUCT far *);
  414.  
  415.     /*-----------------------------------------------------------------------*/
  416.     /*   unsigned int   status;                                              */
  417.     /*   CONTEXT_STRUCT dest_context;                                        */
  418.     /*   CONTEXT_STRUCT source_context;                                      */
  419.     /*                                                                       */
  420.     /*   status = get_set_context (&dest_context,                            */
  421.     /*                             &source_context);                         */
  422.     /*-----------------------------------------------------------------------*/
  423.     unsigned int get_set_context    (CONTEXT_STRUCT far *,
  424.                                            CONTEXT_STRUCT far *);
  425.  
  426.     /*-----------------------------------------------------------------------*/
  427.     /*   unsigned int status,                                                */
  428.     /*                context_size;                                          */
  429.     /*                                                                       */
  430.     /*   status = get_context_size (&context_size);                          */
  431.     /*-----------------------------------------------------------------------*/
  432.     unsigned int get_context_size    (unsigned int far *);
  433.  
  434.     /*-----------------------------------------------------------------------*/
  435.     /*   unsigned int                status;                                 */
  436.     /*   PARTIAL_CONTEXT_LIST_STRUCT pcl;                                    */
  437.     /*   CONTEXT_STRUCT              dest_context;                           */
  438.     /*                                                                       */
  439.     /*   pcl.mappable_region_count = 2;                                      */
  440.     /*   pcl.mappable_region_seg   = 0xC000;                                 */
  441.     /*   pcl.mappable_region_seg   = 0xC400;                                 */
  442.     /*   status = get_partial_context (&pcl,                                 */
  443.     /*                                 &dest_context);                       */
  444.     /*-----------------------------------------------------------------------*/
  445.     unsigned int get_partial_context    (PARTIAL_CONTEXT_LIST_STRUCT far *,
  446.                                                CONTEXT_STRUCT far *);
  447.  
  448.     /*-----------------------------------------------------------------------*/
  449.     /*   unsigned int   status;                                              */
  450.     /*   CONTEXT_STRUCT source_context;                                      */
  451.     /*                                                                       */
  452.     /*   status = set_partial_context (&source_context);                     */
  453.     /*-----------------------------------------------------------------------*/
  454.     unsigned int set_partial_context    (CONTEXT_STRUCT far *);
  455.  
  456.     /*-----------------------------------------------------------------------*/
  457.     /*   unsigned int                status,                                 */
  458.     /*                               partial_context_size;                   */
  459.     /*   PARTIAL_CONTEXT_LIST_STRUCT pcl;                                    */
  460.     /*                                                                       */
  461.     /*   pcl.mappable_region_count = 2;                                      */
  462.     /*   status = get_partial_context_size (pcl.mappable_region_count,       */
  463.     /*                                      &partial_context_size);          */
  464.     /*-----------------------------------------------------------------------*/
  465.     unsigned int get_partial_context_size    (unsigned int,
  466.                                                       unsigned int far *);
  467.  
  468.     /*-----------------------------------------------------------------------*/
  469.     /*   unsigned int status,                                                */
  470.     /*                mode,                                                  */
  471.     /*                mu_count,                                              */
  472.     /*                handle;                                                */
  473.     /*   MAP_STRUCT   mu [MAX_MAPPABLE_REGIONS];                             */
  474.     /*                                                                       */
  475.     /*   mode                   = SEG_MODE;                                  */
  476.     /*   mu_count               = 2;                                         */
  477.     /*   mu[0].log_page         = 0;                                         */
  478.     /*   mu[0].phys_page_or_seg = 0xC000;                                    */
  479.     /*   mu[1].log_page         = 1;                                         */
  480.     /*   mu[1].phys_page_or_seg = 0xC400;                                    */
  481.     /*   status = map_unmap_pages (mode,                                     */
  482.     /*                             mu_count,                                 */
  483.     /*                             mu,                                       */
  484.     /*                             handle);                                  */
  485.     /*-----------------------------------------------------------------------*/
  486.     unsigned int map_unmap_pages    (unsigned int,
  487.                                            unsigned int,
  488.                                            MAP_STRUCT far *,
  489.                                            unsigned int);
  490.  
  491.     /*-----------------------------------------------------------------------*/
  492.     /*   unsigned int status,                                                */
  493.     /*                pages,                                                 */
  494.     /*                handle;                                                */
  495.     /*                                                                       */
  496.     /*   status = realloc_pages (&pages,                                     */
  497.     /*                           handle);                                    */
  498.     /*-----------------------------------------------------------------------*/
  499.     unsigned int realloc_pages    (unsigned int far *,
  500.                                           unsigned int);
  501.  
  502.     /*-----------------------------------------------------------------------*/
  503.     /*   unsigned int status,                                                */
  504.     /*                attrib,                                                */
  505.     /*                handle;                                                */
  506.     /*                                                                       */
  507.     /*   status = get_handle_attrib (&attrib,                                */
  508.     /*                               handle);                                */
  509.     /*-----------------------------------------------------------------------*/
  510.     unsigned int get_handle_attrib    (unsigned int far *,
  511.                                                unsigned int);
  512.  
  513.     /*-----------------------------------------------------------------------*/
  514.     /*   unsigned int status,                                                */
  515.     /*                attrib,                                                */
  516.     /*                handle;                                                */
  517.     /*                                                                       */
  518.     /*   attrib = VOLATILE;                                                  */
  519.     /*   status = set_handle_attrib (attrib,                                 */
  520.     /*                               handle);                                */
  521.     /*-----------------------------------------------------------------------*/
  522.     unsigned int set_handle_attrib    (unsigned int,
  523.                                                unsigned int);
  524.  
  525.     /*-----------------------------------------------------------------------*/
  526.     /*   unsigned int status,                                                */
  527.     /*                attrib_capability;                                     */
  528.     /*                                                                       */
  529.     /*   status = get_attrib_capability (&attrib_capability);                */
  530.     /*-----------------------------------------------------------------------*/
  531.     unsigned int get_attrib_capability    (unsigned int far *);
  532.  
  533.     /*-----------------------------------------------------------------------*/
  534.     /*   unsigned int       status,                                          */
  535.     /*                      handle;                                          */
  536.     /*   HANDLE_NAME_STRUCT hn;                                              */
  537.     /*                                                                       */
  538.     /*   status = get_handle_name (&hn,                                      */
  539.     /*                             handle);                                  */
  540.     /*-----------------------------------------------------------------------*/
  541.     unsigned int get_handle_name    (HANDLE_NAME_STRUCT far *,
  542.                                            unsigned int);
  543.  
  544.     /*-----------------------------------------------------------------------*/
  545.     /*   unsigned int       status,                                          */
  546.     /*                      handle;                                          */
  547.     /*   HANDLE_NAME_STRUCT hn;                                              */
  548.     /*                                                                       */
  549.     /*   status = set_handle_name (&hn,                                      */
  550.     /*                             handle);                                  */
  551.     /*-----------------------------------------------------------------------*/
  552.     unsigned int set_handle_name    (HANDLE_NAME_STRUCT far *,
  553.                                            unsigned int);
  554.  
  555.     /*-----------------------------------------------------------------------*/
  556.     /*   unsigned int      status,                                           */
  557.     /*                     hd_count;                                         */
  558.     /*   HANDLE_DIR_STRUCT hd [MAX_HANDLES];                                 */
  559.     /*                                                                       */
  560.     /*   status = get_handle_dir (&hd_count,                                 */
  561.     /*                            hd);                                       */
  562.     /*-----------------------------------------------------------------------*/
  563.     unsigned int get_handle_dir    (unsigned int far *,
  564.                                            HANDLE_DIR_STRUCT far *);
  565.  
  566.     /*-----------------------------------------------------------------------*/
  567.     /*   unsigned int       status,                                          */
  568.     /*                      handle;                                          */
  569.     /*   HANDLE_NAME_STRUCT hn;                                              */
  570.     /*                                                                       */
  571.     /*   status = search_handle_name (&hn,                                   */
  572.     /*                                &handle);                              */
  573.     /*-----------------------------------------------------------------------*/
  574.     unsigned int search_handle_name    (HANDLE_NAME_STRUCT far *,
  575.                                                unsigned int far *);
  576.  
  577.     /*-----------------------------------------------------------------------*/
  578.     /*   unsigned int status,                                                */
  579.     /*                max_handle_count;                                      */
  580.     /*                                                                       */
  581.     /*   status = get_total_handles (&max_handle_count);                     */
  582.     /*-----------------------------------------------------------------------*/
  583.     unsigned int get_total_handles    (unsigned int far *);
  584.  
  585.     /*-----------------------------------------------------------------------*/
  586.     /*   unsigned int    status,                                             */
  587.     /*                   mode,                                               */
  588.     /*                   handle;                                             */
  589.     /*   MAP_STRUCT      m [MAX_MAPPABLE_REGIONS];                           */
  590.     /*   MAP_JUMP_STRUCT mj;                                                 */
  591.     /*                                                                       */
  592.     /*   m[0].log_page         = 0;                                          */
  593.     /*   m[0].phys_page_or_seg = 0xC000;                                     */
  594.     /*   m[1].log_page         = 1;                                          */
  595.     /*   m[1].phys_page_or_seg = 0xC400;                                     */
  596.     /*   m[2].log_page         = 2;                                          */
  597.     /*   m[2].phys_page_or_seg = 0xC800;                                     */
  598.     /*   m[3].log_page         = 3;                                          */
  599.     /*   m[3].phys_page_or_seg = 0xCC00;                                     */
  600.     /*                                                                       */
  601.     /*   mode                = SEG_MODE;                                     */
  602.     /*   mj.target_function  = 0xC0000000;                                   */
  603.     /*   mj.map_struct_count = 4;                                            */
  604.     /*   mj.ptr_map_struct   = m;                                            */
  605.     /*                                                                       */
  606.     /*   status = alter_map_jump (mode,                                      */
  607.     /*                            &mj,                                       */
  608.     /*                            handle);                                   */
  609.     /*-----------------------------------------------------------------------*/
  610.     unsigned int alter_map_jump    (unsigned int,
  611.                                            MAP_JUMP_STRUCT far *,
  612.                                            unsigned int);
  613.  
  614.     /*-----------------------------------------------------------------------*/
  615.     /*   unsigned int    status,                                             */
  616.     /*                   mode,                                               */
  617.     /*                   handle;                                             */
  618.     /*   MAP_STRUCT      init_map  [MAX_MAPPABLE_REGIONS];                   */
  619.     /*   MAP_STRUCT      final_map [MAX_MAPPABLE_REGIONS];                   */
  620.     /*   MAP_CALL_STRUCT mc;                                                 */
  621.     /*                                                                       */
  622.     /*   imit_map[0].log_page          = 0;                                  */
  623.     /*   init_map[0].phys_page_or_seg  = 0xC000;                             */
  624.     /*                                                                       */
  625.     /*   final_map[0].log_page         = 1;                                  */
  626.     /*   final_map[0].phys_page_or_seg = 0xC000;                             */
  627.     /*   final_map[1].log_page         = 2;                                  */
  628.     /*   final_map[1].phys_page_or_seg = 0xC400;                             */
  629.     /*                                                                       */
  630.     /*   mode = SEG_MODE;                                                    */
  631.     /*   mc.target_function        = 0xC0000000;                             */
  632.     /*   mc.init_map_struct_count  = 1;                                      */
  633.     /*   mc.ptr_init_map_struct    = init_map;                               */
  634.     /*   mc.final_map_struct_count = 2;                                      */
  635.     /*   mc.ptr_final_map_struct   = final_map;                              */
  636.     /*                                                                       */
  637.      /*   status = alter_map_call (mode,                                      */
  638.     /*                            &mc,                                       */
  639.     /*                            handle);                                   */
  640.     /*-----------------------------------------------------------------------*/
  641.     unsigned int alter_map_call    (unsigned int,
  642.                                            MAP_CALL_STRUCT far *,
  643.                                            unsigned int);
  644.  
  645.     /*-----------------------------------------------------------------------*/
  646.     /*   unsigned int status,                                                */
  647.     /*                call_stack_space_size;                                 */
  648.     /*                                                                       */
  649.     /*   status = get_alter_map_call_stack_size (&call_stack_space_size);    */
  650.     /*-----------------------------------------------------------------------*/
  651.     unsigned int get_alter_map_call_stack_size    (unsigned int far *);
  652.  
  653.     /*-----------------------------------------------------------------------*/
  654.     /*   unsigned int     status;                                            */
  655.     /*   MOVE_XCHG_STRUCT ms;                                                */
  656.     /*                                                                       */
  657.     /*   ms.region_size                 = 640 * 1024;                        */
  658.     /*   ms.source_mem_type             = CONV_MEM;                          */
  659.     /*   ms.source_init_log_page_or_seg = 0x0000;                            */
  660.     /*   ms.source_init_offset          = 0x0000;                            */
  661.     /*   ms.dest_mem_type               = EXP_MEM;                           */
  662.     /*   ms.dest_handle                 = 1;                                 */
  663.     /*   ms.dest_init_log_page_or_seg   = 0;                                 */
  664.     /*   ms.dest_init_offset            = 0x0000;                            */
  665.     /*                                                                       */
  666.     /*   status = move_memory_region (&ms);                                  */
  667.     /*-----------------------------------------------------------------------*/
  668.     unsigned int move_memory_region            (MOVE_XCHG_STRUCT far *);
  669.  
  670.     /*-----------------------------------------------------------------------*/
  671.     /*   unsigned int     status;                                            */
  672.     /*   MOVE_XCHG_STRUCT xs;                                                */
  673.     /*                                                                       */
  674.     /*   xs.region_size                 = 640 * 1024;                        */
  675.     /*   xs.source_mem_type             = EXP_MEM;                           */
  676.     /*   xs.source_handle               = 1;                                 */
  677.     /*   xs.source_init_log_page_or_seg = 0;                                 */
  678.     /*   xs.source_init_offset          = 0x0000;                            */
  679.     /*   xs.dest_mem_type               = CONV_MEM;                          */
  680.     /*   xs.dest_init_log_page_or_seg   = 0x0000;                            */
  681.     /*   xs.dest_init_offset            = 0x0000;                            */
  682.     /*                                                                       */
  683.     /*   status = xchg_memory_region (&xs);                                  */
  684.     /*-----------------------------------------------------------------------*/
  685.     unsigned int xchg_memory_region            (MOVE_XCHG_STRUCT far *);
  686.  
  687.     /*-----------------------------------------------------------------------*/
  688.     /*   unsigned int           status,                                      */
  689.     /*                          mcr_count;                                   */
  690.     /*   MAPPABLE_REGION_STRUCT mcr [MAX_MAPPABLE_REGIONS];                  */
  691.     /*                                                                       */
  692.     /*   status = get_mappable_conv_regions (&mcr_count,                     */
  693.     /*                                       mcr);                           */
  694.     /*-----------------------------------------------------------------------*/
  695.     unsigned int get_mappable_conv_regions    (unsigned int far *,
  696.                                                        MAPPABLE_REGION_STRUCT far *);
  697.  
  698.     /*-----------------------------------------------------------------------*/
  699.     /*   unsigned int           status,                                      */
  700.     /*                          mer_count;                                   */
  701.     /*   MAPPABLE_REGION_STRUCT mer [MAX_MAPPABLE_REGIONS];                  */
  702.     /*                                                                       */
  703.     /*   status = get_mappable_exp_regions (&mer_count,                      */
  704.     /*                                      mer);                            */
  705.     /*-----------------------------------------------------------------------*/
  706.     unsigned int get_mappable_exp_regions        (unsigned int far *,
  707.                                                           MAPPABLE_REGION_STRUCT far *);
  708.  
  709.     /*-----------------------------------------------------------------------*/
  710.     /*   unsigned int           status,                                      */
  711.     /*                          mr_count;                                    */
  712.     /*   MAPPABLE_REGION_STRUCT mr [MAX_MAPPABLE_REGIONS];                   */
  713.     /*                                                                       */
  714.     /*   status = get_mappable_regions (&mr_count,                           */
  715.     /*                                  mr);                                 */
  716.     /*-----------------------------------------------------------------------*/
  717.     unsigned int get_mappable_regions            (unsigned int far *,
  718.                                                           MAPPABLE_REGION_STRUCT far *);
  719.                  
  720.     /*-----------------------------------------------------------------------*/
  721.     /*   unsigned int status,                                                */
  722.     /*                mcr_count;                                             */
  723.     /*                                                                       */
  724.     /*   status = get_mappable_conv_region_count (&mcr_count);               */
  725.     /*-----------------------------------------------------------------------*/
  726.     unsigned int get_mappable_conv_region_count    (unsigned int far *);
  727.  
  728.     /*-----------------------------------------------------------------------*/
  729.     /*   unsigned int status,                                                */
  730.     /*                mer_count;                                             */
  731.     /*                                                                       */
  732.     /*   status = get_mappable_exp_region_count (&mer_count);                */
  733.     /*-----------------------------------------------------------------------*/
  734.     unsigned int get_mappable_exp_region_count    (unsigned int far *);
  735.  
  736.     /*-----------------------------------------------------------------------*/
  737.     /*   unsigned int status,                                                */
  738.     /*                mr_count;                                              */
  739.     /*                                                                       */
  740.     /*   status = get_mappable_region_count (&mr_count);                     */
  741.     /*-----------------------------------------------------------------------*/
  742.     unsigned int get_mappable_region_count    (unsigned int far *);
  743.  
  744.     /*-----------------------------------------------------------------------*/
  745.     /*   unsigned int status,                                                */
  746.     /*                pf_count;                                              */
  747.     /*                                                                       */
  748.     /*   status = get_page_frame_count (&pf_count);                          */
  749.     /*-----------------------------------------------------------------------*/
  750.     unsigned int get_page_frame_count    (unsigned int far *);
  751.  
  752.     /*-----------------------------------------------------------------------*/
  753.     /*   unsigned int   status                                               */
  754.     /*   HW_INFO_STRUCT hw_info;                                             */
  755.     /*                                                                       */
  756.     /*   status = get_hw_info (&hw_info);                                    */
  757.     /*-----------------------------------------------------------------------*/
  758.     unsigned int get_hw_info                    (HW_INFO_STRUCT far *);
  759.  
  760.     /*-----------------------------------------------------------------------*/
  761.     /*   unsigned int status,                                                */
  762.     /*                unalloc_raw_pages;                                     */
  763.     /*                                                                       */
  764.     /*   status = get_unalloc_raw_page_count (&unalloc_raw_pages);           */
  765.     /*-----------------------------------------------------------------------*/
  766.     unsigned int get_unalloc_raw_page_count    (unsigned int far *);
  767.  
  768.     /*-----------------------------------------------------------------------*/
  769.     /*   unsigned int status,                                                */
  770.     /*                alloc_raw_pages;                                       */
  771.     /*                                                                       */
  772.     /*   status = get_alloc_raw_page_count (&alloc_raw_pages);               */
  773.     /*-----------------------------------------------------------------------*/
  774.     unsigned int get_alloc_raw_page_count        (unsigned int far *);
  775.  
  776.     /*-----------------------------------------------------------------------*/
  777.     /*   unsigned int status,                                                */
  778.     /*                total_raw_pages;                                       */
  779.     /*                                                                       */
  780.     /*   status = get_total_raw_page_count (&total_raw_pages);               */
  781.     /*-----------------------------------------------------------------------*/
  782.     unsigned int get_total_raw_page_count        (unsigned int far *);
  783.  
  784.     /*-----------------------------------------------------------------------*/
  785.     /*   unsigned int status,                                                */
  786.     /*                std_page_count,                                        */
  787.     /*                handle;                                                */
  788.     /*                                                                       */
  789.     /*   status = alloc_std_pages (std_page_count,                           */
  790.     /*                             &handle);                                 */
  791.     /*-----------------------------------------------------------------------*/
  792.     unsigned int alloc_std_pages                (unsigned int,
  793.                                                        unsigned int far *);
  794.  
  795.     /*-----------------------------------------------------------------------*/
  796.     /*   unsigned int status,                                                */
  797.     /*                raw_page_count,                                        */
  798.     /*                handle;                                                */
  799.     /*                                                                       */
  800.     /*   status = alloc_raw_pages (raw_page_count,                           */
  801.     /*                             &handle);                                 */
  802.     /*-----------------------------------------------------------------------*/
  803.     unsigned int alloc_raw_pages                (unsigned int,
  804.                                                  unsigned int far *);
  805.  
  806.     /*-----------------------------------------------------------------------*/
  807.     /*   unsigned int       status,                                          */
  808.     /*                      alt_reg_set;                                     */
  809.     /*   CONTEXT_STRUCT far *far_ptr_alt_context;                            */
  810.     /*                                                                       */
  811.     /*   status = get_alt_reg_set (&alt_reg_set,                             */
  812.     /*                             &far_ptr_alt_context);                    */
  813.     /*-----------------------------------------------------------------------*/
  814.     unsigned int get_alt_reg_set        (unsigned int far *,
  815.                                                CONTEXT_STRUCT far * far *);
  816.  
  817.     /*-----------------------------------------------------------------------*/
  818.     /*   unsigned int          status,                                       */
  819.     /*                         alt_reg_set;                                  */
  820.     /*   static CONTEXT_STRUCT alt_context;                                  */
  821.     /*                                                                       */
  822.     /*   status = set_alt_reg_set (alt_reg_set,                              */
  823.     /*                             &alt_context);                            */
  824.     /*-----------------------------------------------------------------------*/
  825.     unsigned int set_alt_reg_set        (unsigned int,
  826.                                                CONTEXT_STRUCT far *);
  827.  
  828.     /*-----------------------------------------------------------------------*/
  829.     /*   unsigned int status,                                                */
  830.     /*                context_size;                                          */
  831.     /*                                                                       */
  832.     /*   status = get_alt_context_size (&context_size);                      */
  833.     /*-----------------------------------------------------------------------*/
  834.     unsigned int get_alt_context_size    (unsigned int far *);
  835.  
  836.     /*-----------------------------------------------------------------------*/
  837.     /*   unsigned int status,                                                */
  838.     /*                alt_reg_set;                                           */
  839.     /*                                                                       */
  840.     /*   status = alloc_alt_reg_set (&alt_reg_set);                          */
  841.     /*-----------------------------------------------------------------------*/
  842.     unsigned int alloc_alt_reg_set    (unsigned int far *);
  843.  
  844.     /*-----------------------------------------------------------------------*/
  845.     /*   unsigned int status,                                                */
  846.     /*                alt_reg_set;                                           */
  847.     /*                                                                       */
  848.     /*   status = dealloc_alt_reg_set (alt_reg_set);                         */
  849.     /*-----------------------------------------------------------------------*/
  850.     unsigned int dealloc_alt_reg_set    (unsigned int);
  851.  
  852.     /*-----------------------------------------------------------------------*/
  853.     /*   unsigned int status,                                                */
  854.     /*                DMA_reg_set;                                           */
  855.     /*                                                                       */
  856.     /*   status = alloc_DMA_reg_set (&DMA_reg_set);                          */
  857.     /*-----------------------------------------------------------------------*/
  858.     unsigned int alloc_DMA_reg_set    (unsigned int far *);
  859.  
  860.     /*-----------------------------------------------------------------------*/
  861.     /*   unsigned int status,                                                */
  862.     /*                DMA_reg_set,                                           */
  863.     /*                DMA_channel;                                           */
  864.     /*                                                                       */
  865.     /*   status = enable_DMA_reg_set (DMA_reg_set,                           */
  866.     /*                                DMA_channel);                          */
  867.     /*-----------------------------------------------------------------------*/
  868.     unsigned int enable_DMA_reg_set    (unsigned int,
  869.                                                unsigned int);
  870.  
  871.     /*-----------------------------------------------------------------------*/
  872.     /*   unsigned int status,                                                */
  873.     /*                DMA_reg_set;                                           */
  874.     /*                                                                       */
  875.     /*   status = disable_DMA_reg_set (DMA_reg_set);                         */
  876.     /*-----------------------------------------------------------------------*/
  877.     unsigned int disable_DMA_reg_set    (unsigned int);
  878.  
  879.     /*-----------------------------------------------------------------------*/
  880.     /*   unsigned int status,                                                */
  881.     /*                DMA_reg_set;                                           */
  882.     /*                                                                       */
  883.     /*   status = dealloc_DMA_reg_set (DMA_reg_set);                         */
  884.     /*-----------------------------------------------------------------------*/
  885.     unsigned int dealloc_DMA_reg_set    (unsigned int);
  886.  
  887.     /*-----------------------------------------------------------------------*/
  888.     /*   unsigned int status;                                                */
  889.     /*                                                                       */
  890.     /*   status = prep_EMM_warmboot();                                       */
  891.     /*-----------------------------------------------------------------------*/
  892.     unsigned int prep_EMM_warmboot        (void);
  893.  
  894.     /*-----------------------------------------------------------------------*/
  895.     /*   unsigned int  status;                                               */
  896.     /*   unsigned long access_key;                                           */
  897.     /*                                                                       */
  898.     /*   status = enable_OS_fcns (&access_key);                              */
  899.     /*-----------------------------------------------------------------------*/
  900.     unsigned int enable_OS_fcns            (unsigned long far *);
  901.  
  902.     /*-----------------------------------------------------------------------*/
  903.     /*   unsigned int  status                                                */
  904.     /*   unsigned long access_key;                                           */
  905.     /*                                                                       */
  906.     /*   status = disable_OS_fcns (&access_key);                             */
  907.     /*-----------------------------------------------------------------------*/
  908.     unsigned int disable_OS_fcns            (unsigned long far *);
  909.  
  910.     /*-----------------------------------------------------------------------*/
  911.     /*   unsigned int  status                                                */
  912.     /*   unsigned long access_key;                                           */
  913.     /*                                                                       */
  914.     /*   status = return_OS_access_key (access_key);                         */
  915.     /*-----------------------------------------------------------------------*/
  916.     unsigned int return_OS_access_key        (unsigned long far *);
  917.  
  918.